// class Person {
//     say() {
//         console.log('say hello');
//     }
// }

// const person = new Person();
// person.say();

class Baidu {
    constructor(url) {
        this.url = url;
    }

    static getInstance(url) {
        if(!Baidu.instance) {
            Baidu.instance = url;
        }
        return Baidu.instance;
    }
}
let b3 = new Baidu("www.126.com");
let b = Baidu.getInstance("www.baidu.com")
let b1 = Baidu.getInstance("www.163.com")
console.log(b1,b,b3);